using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using Contoso.Workflow.LocalService;
using Contoso.Workflow.Model;

namespace Contoso.Workflow
{
    public sealed partial class ExpenseWorkflow : StateMachineWorkflowActivity
    {
        private ExpenseData internalExpenseData;

        public ExpenseData ExpenseDataProperty
        {
            get { return internalExpenseData; }
            set { internalExpenseData = value; }
        }
	
        public ExpenseWorkflow()
        {
            InitializeComponent();
        }

        private void handleRequestEventActivity_Invoked(object sender, ExternalDataEventArgs e)
        {
            ExpenseEventArgs expenseEventArgs = (ExpenseEventArgs)e;
            internalExpenseData.Account = expenseEventArgs.ExpenseDataProperty.Account;
            internalExpenseData.Reason = expenseEventArgs.ExpenseDataProperty.Reason;
        }

        private void handlePMCheckApproveEventActivity_Invoked(object sender, ExternalDataEventArgs e)
        {
            ExpenseEventArgs expenseEventArgs = (ExpenseEventArgs)e;
            internalExpenseData.PMSuggestion = expenseEventArgs.ExpenseDataProperty.PMSuggestion;
        }

        private void handlePMCheckRejectEventActivity_Invoked(object sender, ExternalDataEventArgs e)
        {
            ExpenseEventArgs expenseEventArgs = (ExpenseEventArgs)e;
            internalExpenseData.PMSuggestion = expenseEventArgs.ExpenseDataProperty.PMSuggestion;
        }

        private void handleGMCheckApproveEventActivity_Invoked(object sender, ExternalDataEventArgs e)
        {
            ExpenseEventArgs expenseEventArgs = (ExpenseEventArgs)e;
            internalExpenseData.GMSuggestion = expenseEventArgs.ExpenseDataProperty.GMSuggestion;
        }

        private void handleAccountPaymentEventActivity_Invoked(object sender, ExternalDataEventArgs e)
        {
            ExpenseEventArgs expenseEventArgs = (ExpenseEventArgs)e;
            internalExpenseData.AccountantSuggestion = expenseEventArgs.ExpenseDataProperty.AccountantSuggestion;
        }
    }
}
